<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="/images/favicon.png" type="image/png">

        <title>
	        <?php if(isset($strTitle)){
	        	echo $strTitle;
	        }?>
        </title>

        <link href="/css/style.default.css" rel="stylesheet">

        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="js/html5shiv.js"></script>
        <script src="js/respond.min.js"></script>
        <![endif]-->
         <script src="/js/jquery-1.10.2.min.js"></script>
    </head>

    <body>

        <!-- Preloader -->
        <div id="preloader">
            <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
        </div>

        <section>

            <div class="leftpanel">

                <div class="logopanel">
                    <img src="/images/mynote1.png" />
                </div><!-- logopanel -->

                <div class="leftpanelinner">
                    <h5 class="sidebartitle">Menu</h5>
                    <ul class="nav nav-pills nav-stacked nav-bracket">
                        <li><a href="/Dashboard"><i class="fa fa-home"></i> <span>Dashboard</span></a></li>
                        <?php foreach($menuTopic as $item){?>
                        	 <li class="nav-parent"><a href="#"><i class="fa fa-suitcase"></i> <span><?php echo $item['Topic']['name']; ?></span></a>
                        	 	<ul class="children">
                        	 		<?php foreach($item['Category'] as $i){?>
                        	 			<li><a href="/Categories/<?php echo $i['shortLink']?>"><i class="fa fa-caret-right"></i> <?php echo $i['name']; ?></a></li>
                        	 		<?php }?>
                        	 		
                        	 	</ul>
                        <?php }?>
                    </ul>
                </div><!-- leftpanelinner -->
            </div><!-- leftpanel -->

            <div class="mainpanel">

                <div class="headerbar">

                    <a class="menutoggle"><i class="fa fa-bars"></i></a>

                    <form class="searchform" action="/posts/search" method="post">
                        <input type="text" class="form-control" name="keyword" name="data[strSearch]" placeholder="Search here..." />
                    </form>
					<?php if($userId){?>
                    <div class="header-right">
                        <ul class="headermenu">
                            <li>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                                        <img src="/images/photos/loggeduser.png" alt="" />
                                        <?php echo $userName;?>
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                                        <?php if ($userId && $userId == 1) {?>
										<li><a href="/users/add"><i class="fa fa-user"></i> <span>Account Settings</span></a></li>
										<?php }?>
										<li><a href="/posts"><i class="fa fa-edit"></i> <span>Viết bài</span></a></li>
										<li><a href="/topics"><i class="fa fa-columns"></i> <span>Chủ đề</span></a></li>
										<li><a href="/categories"><i class="fa fa-columns"></i> <span>Chuyên mục</span></a></li>
										<li><a href="/login/logout"><i class="fa fa-sign-out"></i> <span>Sign Out</span></a></li>
										
                                    </ul>
                                </div>
                            </li>
                        </ul>
                    </div><!-- header-right -->
                    <?php }else{?>
                    	<div class="header-right">
	                        <a class="btn btn-success" href="/login" style="margin-right: 26px; margin-top: 8px;">Login</a>
                    	</div>
                	<?php }?>

                </div>
                <div class="contentpanel">
                    <!-- content goes here... -->
					<div class="panel panel-success">
						<div class="panel-heading">
						</div>
						<div class="panel-body">
							<?php echo $this->fetch('content'); ?>
						</div>
					</div>
                </div>

            </div><!-- mainpanel -->

        </section>



       
        <script src="/js/jquery-migrate-1.2.1.min.js"></script>
        <script src="/js/bootstrap.min.js"></script>
        <script src="/js/modernizr.min.js"></script>
        <script src="/js/jquery.sparkline.min.js"></script>
        <script src="/js/toggles.min.js"></script>
        <script src="/js/retina.min.js"></script>
        <script src="/js/jquery.cookies.js"></script>

        <script src="/js/custom.js"></script>

    </body>
</html>
